use iced::{
    widget::{text, column, container},
    Element, Task, Theme, Font, Size,
};

#[derive(Debug, Clone)]
pub enum Message {}

pub struct FontTestApp;

impl FontTestApp {
    pub fn new() -> Self {
        Self
    }

    pub fn update(&mut self, _message: Message) -> Task<Message> {
        Task::none()
    }

    pub fn view(&self) -> Element<Message> {
        let content = column![
            text("Default Font: Hello 你好 世界")
                .size(20),
            
            text("SimSun Font: Hello 你好 世界")
                .font(Font::with_name("SimSun"))
                .size(20),
            
            text("Microsoft YaHei Font: Hello 你好 世界")
                .font(Font::with_name("Microsoft YaHei"))
                .size(20),
            
            text("SimHei Font: Hello 你好 世界")
                .font(Font::with_name("SimHei"))
                .size(20),
            
            text("System Default: Hello 你好 世界")
                .font(Font::DEFAULT)
                .size(20),
            
            text("Monospace: Hello 你好 世界")
                .font(Font::MONOSPACE)
                .size(20),
        ]
        .spacing(20)
        .padding(20);

        container(content)
            .width(iced::Length::Fill)
            .height(iced::Length::Fill)
            .center_x()
            .center_y()
            .into()
    }

    pub fn theme(&self) -> Theme {
        Theme::Dark
    }
}

fn main() -> iced::Result {
    iced::application("Font Test", FontTestApp::update, FontTestApp::view)
        .theme(FontTestApp::theme)
        .window_size(Size::new(800.0, 600.0))
        .run_with(|| (FontTestApp::new(), Task::none()))
}
